package modelx

import (
	"time"
)

type Xorm struct {
	ID       int       `xorm:"bigint pk autoincr 'id' comment('name')"`
	Name     string    `xorm:"varchar(25) not null   'name' comment('name')"`
	Age      uint8     `xorm:"smallint    'age' comment('Age')"`
	IsRoot   bool      `xorm:"bool    'is_root' comment('IsRoot')"`
	UserName string    `xorm:"varchar(25)    'user_name' comment('UserName')"`
	Password string    `xorm:"varchar(25)     default 0 'password' comment('Password')"`
	Tags     []string  `xorm:"json 'tags' comment('Password')"`
	IDS      []int     `xorm:"json 'ids' comment('Password')"`
	Data     []Std     `xorm:"json 'data' comment('data')"`
	Rating   float32   `json:"rating" xorm:"'rating'"`
	CreateAt time.Time `json:"create_at" xorm:"'create_at' created"`
	Time     time.Time `json:"time" xorm:"'time'"`
}

func (r Xorm) TableName() string {
	return "a_user_test"
}

type Std struct {
	Name string `gorm:"column:name;type:varchar(255);"`
	Age  string `gorm:"column:age;type:varchar(255);"`
}
